package LinkedLlist;

public class ListTest {
    //将俩个有序的链表合成新的链表
   /* public static SingList.ListNode Merge (SingList.ListNode pHead1, SingList.ListNode pHead2) {
        SingList.ListNode New = new SingList.ListNode(-1);
        SingList.ListNode head1 = pHead1;
        SingList.ListNode head2 = pHead2;

        SingList.ListNode head3 = New ;
        while (pHead1!=null&&pHead2!=null){
            if(head1.vale>head2.vale){
                head3.next =head1;
                head1 = head1.next;
            }else {
                head3.next =head2;
                head2 = head1.next;
            }
            head3 = head3.next;
        }
        if (pHead1!=null){
            head3.next =pHead1;

        }
        if(pHead2!=null){
            head3.next =pHead2;

        }
        // write code here
        return New;
    }*/

   /* public static void main1(String[] args) {
        SingList singList1 = new SingList();
        singList1.addLast(10);
        singList1.addLast(11);
        singList1.addLast(12);
        singList1.addLast(13);
        singList1.addLast(14);

        SingList singList2 = new SingList();
        singList2.addLast(20);
        singList2.addLast(21);
        singList2.addLast(22);
        singList2.addLast(23);
        singList2.addLast(24);

        SingList.ListNode nh = Merge(singList1.head, singList2.head);
       *//* System.out.println(nh);
        singList1.display(nh);*//*
        singList1.display();*/
    public static void main(String[] args) {
        SingList singList = new SingList();
       singList.newlist();
        singList.display();
        /*singList.addFirst(10);
        singList.display();
       singList.addLast(10);
       singList.display();
       singList.removeAllKey(10);
       singList.display( );
       SingList.ListNode A =singList.FindKthToTail(2);
        System.out.println(A.vale);*/
//       boolean a = singList.contains(40);
//        System.out.println(a);
        singList.addIndex(0,99);
        singList.addIndex(3,98);
        singList.addIndex(6,97);
        singList.display();
    }

}
